import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { BizStationUsageRecordVo, BizStationUsageSummaryVo } from './types';

/**
 * 查询站房用量监控（半小时）汇总
 * @param query
 * @returns {*}
 */

export const listUsageSummary = (query?: PageQuery): AxiosPromise<BizStationUsageSummaryVo[]> => {
  return request({
    url: '/biz-station/station/usage/list/summary',
    method: 'get',
    params: query
  });
};
/**
 * 查询站房用量监控（半小时）列表
 * @param query
 * @returns {*}
 */

export const listUsage = (query?: PageQuery): AxiosPromise<BizStationUsageRecordVo[]> => {
  return request({
    url: '/biz-station/station/usage/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询详细
 * @param id
 */
export const getUsage = (id: string | number): AxiosPromise<BizStationUsageRecordVo> => {
  return request({
    url: '/biz-station/station/usage/' + id,
    method: 'get'
  });
};

/**
 * 设置扩容参数
 * @param id
 */
export const setExpansion = (id: string | number, params: any) => {
  return request({
    url: '/biz-station/station/usage/expansion/' + id,
    method: 'put',
    params
  });
};